(C) 1996 AROS - The Amiga Replacement OS
The utility.library math functions are unlike all other utility functions in that they don't require the library base to be loaded in register A6, and they also save the values of the address registers A0/A1.
This function is mainly to support assembly programers, and is probably of limited use to higher-level language programmers.
LONG a = 352543; LONG b = 52464; LONG c = UMult32(a,b); c == 1315946768
It is for m68k-native...
To emulate this operation we are performing the operation:
(2^16 * a + b) * (2^16 * c + d) = 2^32 * ab + 2^16 * ad + 2^16 * bc + bd = 2^32 * ab + 2^16 ( ad + bc ) + bd
Now since the result is a 32-bit number, the 2^32 term will have no effect. (Since 2^32 > max (32-bit number).
Therefore: product = 2^16( ad + bc ) + bd